package com.hsh.tools.handler;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 自定义异常 ~~~ handler
 */
@Data
public class BusinessException extends BusinessDisposeException {

    @ApiModelProperty(value = "状态码")
    private Integer code;

    @ApiModelProperty(value = "错误信息")
    private String errMsg;

    public BusinessException() {
        super();
    }

    public BusinessException(String message) {
        super(message);
        this.code = -1;
        this.errMsg = message;
    }

    public BusinessException(CustomizeResultCode customizeResultCode) {
        this.code = customizeResultCode.getCode();
        this.errMsg = customizeResultCode.getMessage();
    }

    public BusinessException(CustomizeResultCode customizeResultCode, String message) {
        this.code = customizeResultCode.getCode();
        this.errMsg = message;
    }
}
